#include <vector>
#include <iostream>
#include <algorithm>
#include <iterator>

using std::vector;
using std::cout;

template<class Container,class OutputIterator>
OutputIterator copy(const Container &c,OutputIterator result){
	copy(c.begin(),c.end(),result);
}

int main(){
	vector<int> vec;
	cout << vec.capacity();
//	vec[2]=23;
	
	try{
		vec.at(5)=11;
	}catch(...){
		cout<<" access error\n";
	}
	
	vec.reserve(100);
	
	for(int i=0;i<100;i++)
		vec.push_back(i);
	
	cout<< "vec size:"<<vec.size()<<"\n";
	/*
	for(vector<int>::const_iterator i=vec.begin();i!=vec.end();i++){
		cout<<*i << "\t";
	}
	*/
	copy(vec.begin(),vec.end(),std::ostream_iterator<int>(cout,"\t"));
	return 0;
}
